<!DOCTYPE html>
<html>
<head>
<title>逾期记录</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<#include "../../../include/resources.html">
<script type="text/javascript">
    //$.fn.iframeWidthResize(640);//页面最小宽度设置
    var dataGrid;
    var winWidth =  420;
    var winHeight = 300;
    var editTitle = "逾期垫付";
	var editUrl =  "/modules/loan/borrowLate/borrowLateEditPage.html";
    var editWinParmeters = "'{0}','"+editTitle+"',"+winWidth+","+winHeight+",'"+editUrl+"'";
    $(function() {
        dataGrid = $('#dataGrid').datagrid({
            url : ' borrowLateList.html',
            fit : true,
            border : false,
            pagination : true,
            idField : 'id',
            pageSize : pageSize,
            pageNums :1,
            pageList : pageList,
            sortName : 'id',
            sortOrder : 'desc',
            checkOnSelect : false,
            selectOnCheck : false,
            nowrap : false,
			singleSelect:true,
              
            columns : [ [
				{ field: 'id', title: '编号', width: 50,fixed: true, sortable:false },              
				{ field: 'userName', title: '用户名', width: 80,fixed: true, sortable:false },
				{ field: 'realName', title: '借款人姓名', width: 80,fixed: true, sortable:false },
				{ field: 'borrowName', title: '标名', width: 210, sortable:false },
	              { field: 'period', title: '期数', width: 50,fixed: true, sortable:false, 
	            	  	formatter: function(value,row,index){
	  						return row.period+1;
					  	}
	              },
	              { field: 'capital', title: '本金(元)', width: 80, sortable:false },
	              { field: 'interest', title: '利息(元)', width: 80, sortable:false },
	              
	              { field: 'lateDays', title: '逾期天数', width: 80, sortable:false },
	              { field: 'lateInterest', title: '罚息(元)', width: 60, sortable:false },
	              { field: 'status', title: '状态', width: 80,fixed: true, sortable:false , 
						formatter: function(value,row,index){
	  					if (row.status == 0){
	  						return '未还款';
	  					} else if (row.status == 1){
	  						return '已还款';
	  					} else if (row.status == 2){
	  						return '网站垫付';
	  					} else if (row.status == 3){
	  						return '还款处理中';
	  					} else if (row.status == 4){
	  						return '代偿处理中';
	  					} else if (row.status == 5){
	  						return '部分还款';
	  					} else {
	  						return value;
	  					}
	  				}  
	              },
	              { field : 'showInfo',
	                  title : '其他信息',
	                  width :75,
	                  align:'center',
	                  fixed:true,
	                  formatter : function(value, row, index) {
	  					var content = '<a href="javascript:void(0);" class="j-showInfo">查看<i class="iconfont">&#xe639;</i></a>'
	  						+ '<div class="showInfoSingleDiv">'
	  						+ '<div class="showInfo">'
	  						+ '<em></em><h2>逾期信息</h2>'
	  						+ '<ul>'
	  						+ '<li>'
	                  		+ '<span>预还金额(元)：</span>'
	  						+ row.repaymentAccount
	  						+ '</li>'
	  						+ '<li>'
	                  		+ '<span>已还金额(元)：</span>'
	  						+ row.repaymentYesAccount
	  						+ '</li>'
	  						+ '<li>'
	                  		+ '<span>预计还款时间：</span>'
	  						+ getLocalTime(row.repaymentTime,4)
	  						+ '</li>'
	  						+ '<li>'
	                  		+ '<span>实际还款时间：</span>'
	  						+ getLocalTime(row.repaymentYesTime,4)
	  						+ '</li>'
	  						+ '</ul></div></div>';
	  					return content;
	  				}
	  			},
              {	field : 'action',
  				title : '操作',
  				width :80,
  				fixed: true,
  				formatter : function(value, row, index) {
     					str = '&nbsp;';
     					if (row.status == 0) {
      					str += $.formatString('<img onclick="$.fn.dataGridOptions.editFun('+editWinParmeters+');" src="{1}" title="网站垫付"/>', row.id, '${theme_dir}/css/images/extjs_icons/pencil.png');
      					str += '&nbsp;';
     					} else {
     						str +="已经付款";
     					}
      				return str;
  				}
  				}
              ] ],
            onLoadSuccess : function() {
                $('#searchForm table').show();
                parent.$.messager.progress('close');

            }
        });
    });
</script>
</head>
<body style="padding:0 20px;" >
    <div class="easyui-layout" data-options="fit : true,border : false">
        <div data-options="region:'north',border:false,collapsible:false" id="searchBox">
        	<div class="sLeft">
	            <form id="searchForm">
	            	<input type="text"  name="searchName" class="sInput" placeholder="输入借款人姓名/用户名/标名进行搜索"  autocomplete="off" onkeydown="if(event.keyCode == 13){ $.fn.dataGridOptions.searchFun('#searchForm');return false;}"/><a href="javascript:;" title="查询" class="sBtn" onclick="$.fn.dataGridOptions.searchFun('#searchForm');">查询</a><a href="javascript:;" class="advBtn" title="条件查询">条件查询 <i class="iconfont">&#xe638;</i></a>
	           		<a href="javascript:void(0);" class="reloadIcon" onclick="dataGrid.datagrid('reload');" title="刷新" ><i class="iconfont">&#xe603;</i></a>
	            </form>
            </div>
            <form id="showAdw">
		        <ul class="showAdw" style="display:none;">
		        	<a href="javascript:void(0);"><i class="iconfont closeWin">&#xe628;</i></a>
		       		<li><span>借款人姓名</span><input type="text" name="realName" autocomplete="off"/></li>
		       		<li><span>用户名</span><input type="text" name="userName" autocomplete="off"/></li>
		       		<li><span>状态</span><select name="status" class="status">
		                  <option value="99" selected="selected">全部</option>
		                  <option value="0">未还款</option>
		                  <option value="1">已还款</option>
		                  <option value="2">网站垫付</option>
		                  <option value="3">还款处理中</option>
		                  <option value="5">部分还款</option>
		                </select></li>
		       		<li><span>时间</span><input type="text" name="startTime" id="startTime" onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'endTime\')}',readOnly:true})" class="searchTime"/>&nbsp;-&nbsp;<input type="text" name="endTime" id="endTime" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'startTime\')}',readOnly:true})" class="searchTime"/></li>
		       		<li><span>&nbsp;</span><a href="javascript:void(0);" class="searchBtn sureBtn" onclick="$.fn.dataGridOptions.searchFun('#showAdw');">确定</a><a href="javascript:void(0);" class="searchBtn" onclick="$.fn.dataGridOptions.cleanFun('#searchForm');">重置</a></li>
		        </ul>
	        </form>
        </div>
        <div data-options="region:'center'" style="margin-top:30px;padding-bottom:30px;">
            <table id="dataGrid"></table>
        </div>
    </div>

</body>
</html>
<script src="${theme_dir}/js/search.js"></script>